/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package org.beiyou;

/**
 * <p>Project: jse2204 - Ex1
 * <p>Powered by webrx On 2022-09-08 08:48:22
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex1 {
    static int i = 0;

    public static void main(String[] args) {
        //show(3);

        //print(13);

        Ex1 ex = new Ex1();
        ex.view(5);

        m2(5);
    }

    public static void show(int n) {
        System.out.println(n);
    }

    public static void print(int n) {
        System.out.println(n);
        if (n > 1) {
            print(--n);
        }
    }


    public void view(int n) {
        System.out.println(i++);
        if (i <= n) view(n);

        //if (n == -1) return;
        //view(--n);
        //System.out.println(n+1);
    }

    public static void m2(int n) {
        if (n == -1) return;
        m2(n - 1);
        System.out.println(n);
    }
}
